using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GSNConf.GenConfigControls
{
    public partial class GenConfigForm : Form
    {
        private UserControl configControl = null;

        public GenConfigForm(UserControl configControl, string title)
        {
            InitializeComponent();

            this.Text = title;

            configPanel.Controls.Add(configControl);
            configPanel.Width = configControl.Width;
            configPanel.Height = configControl.Height;
            this.Height = configPanel.Height + 80;

            this.configControl = configControl;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (configControl.ValidateChildren())
            {
                DialogResult = DialogResult.OK;
                Close();
            }
                
        }
    }
}
